<!DOCTYPE html>
<html>
  <head>
    <script src="../dist/jspsych.js"></script>
    <script src="../dist/plugin-survey-likert.js"></script>
    <link rel="stylesheet" href="../dist/jspsych.css" />
  </head>
  <body></body>
  <script>

    var jsPsych = initJsPsych({
      on_finish: function() {
        jsPsych.data.displayData();
      }
    });

    var scale = ["Strongly Disagree", "Disagree", "Neutral", "Agree", "Strongly Agree"];

    var likert_trial = {
        type: jsPsychSurveyLikert,
        questions: [
          {prompt: "I like vegetables.", name: 'Vegetables', labels: scale, required: true},
          {prompt: "I like fruit.", name: 'Fruit', labels: scale, required: true}
        ],
    };

    var likert_trial_random_order = {
        type: jsPsychSurveyLikert,
        questions: [
          {prompt: "Question 1", labels: scale},
          {prompt: "Question 2", labels: scale},
          {prompt: "Question 3", labels: scale},
          {prompt: "Question 4", labels: scale},
          {prompt: "Question 5", labels: scale}
        ],
        randomize_question_order: true,
        scale_width: 500
    };

    jsPsych.run([likert_trial, likert_trial_random_order]);
    
  </script>
</html>
